{extend name="admin/layout" /}
{block name="main"}
<div class="row">
    <div class="col-sm-12">
        <h4 class="page-title">
            <ul class="breadcrumb">
                <li><i class="fa fa-home"></i><a href="/"> 首页</a></li>
                <li><i class="fa fa-desktop"></i><a href="{:url('index')}"> 管理后台</a></li>
                <li class="active">用户列表</li>
            </ul>
        </h4>
    </div>
</div>
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                用户列表
            </div>
            <div class="panel-body">
                <form method="post">
                    <input type="hidden" name="action" value="search">
                    <div class="input-group xs-mb-15">
                        <input type="text" placeholder="请输入要搜索的用户名或者QQ！" name="s"
                               class="form-control text-center"
                               required>
                        <span class="input-group-btn">
                        <button type="submit" class="btn btn-primary">立即搜索</button>
                        </span>
                    </div>
                </form>
            </div>
            <div class="panel-body">
                <div class="col-lg-12 table-responsive">
                    <table class="table table-bordered table-condensed table-hover table-striped table-vertical-center">
                        <thead>
                        <tr>
                            <th>UID</th>
                            <th>用户名</th>
                            <th>身份</th>
                            <th>所属站点</th>
                            <th>QQ</th>
                            <th>余额</th>
                            <th>充值余额</th>
                            {if condition="ZID eq 1"}<th>扣除金额</th>{/if}
                            <th>注册时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="$userList" id="user"}
                        <tr>
                            <td>{$user.uid}</td>
                            <td>{$user.user}</td>
                            <td>
                                <form method="post">
                                    <input type="hidden" name="action" value="daili">
                                    <input type="hidden" name="uid" value="{$user.uid}">
                                    <select name="power">
                                        <option value="0">普通用户</option>
                                        {for start="1" end="6"}
                                        <option value="{$i}" {if condition="$user.power eq $i"}selected{/if}>VIP{$i}</option>
                                        {/for}
                                    </select>
                                    <button>修改</button>
                                </form>
                            </td>
                            <td>{$user.zid}</td>
                            <td>{$user.qq}</td>
                            <td>{$user.point}</td>
                            <td>
                                <form method="post">
                                    <input type="hidden" name="action" value="cz">
                                    <input type="hidden" name="uid" value="{$user.uid}">
                                    <input type="text" name="point" value="1" style="width: 80px;;">
                                    <input type="submit" value="充值">
                                </form>
                            </td>
                            {if condition="ZID eq 1"}<td>
                                <form method="post">
                                    <input type="hidden" name="action" value="kc">
                                    <input type="hidden" name="uid" value="{$user.uid}">
                                    <input type="text" name="point" value="1" style="width: 80px;;">
                                    <input type="submit" value="扣除">
                                </form>
                            </td>{/if}
                            <td>{$user.regtime}</td>
                            <td>
                                <a href="?action=del&uid={$user.uid}" class="btn-xs btn-warning"
                                   onclick="return confirm('确认删除？');">删除</a>
                                <a href="{:url('userinfo',['uid'=>$user.uid])}" class="btn-xs btn-info">修改</a>
                            </td>
                        </tr>
                        {/volist}
                        <tr class="text-center">
                            <td colspan="15">{$pageList->showPage()}</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}